package com.vhall.component.entity.room.enums;

import com.vhall.component.entity.dictionary.enums.BaseEnum;
import com.vhall.component.entity.goods.enums.GuoxinPrdTypeEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 投资期限-
 *
 * @author xing.wang
 * @date 2023/8/7
 */
@Getter
@AllArgsConstructor
public enum InvestPeriodEnum implements BaseEnum {
    NO_REQUIREMENT("0", "无要求"),
    YEAR_0_TO_1("1", "0(含)到1年(含)"),
    YEAR_1_TO_3("2", "1(不含)到3年(含)"),
    YEAR_3_TO_5("3", "3(不含)到5年(含)"),
    YEAR_5_ABOVE("4", "5年(不含)以上");
    private final String value;
    private final String name;
    @Override
    public String getValue() {
        return value;
    }
    @Override
    public String getName() {
        return name;
    }
    /**
     * 通过 value 获取 name
     * @param value
     * @return
     */
    public static String getNameByValue(String value) {
        for (InvestPeriodEnum e : InvestPeriodEnum.values()) {
            if (e.getValue().equals(value)) {
                return e.getName();
            }
        }
        return null;
    }
}
